<template>
  <div class="app-container">
    <div class="block">
      <el-timeline reverse>
        <el-timeline-item
          v-for="(item,index) in HouseEventList"
          :key="index"
          :timestamp="parseTime(item.oprtime,'{y}-{m}-{d} {h}:{i}:{s}')"
          placement="top">
          <el-card>
            <h3 v-text="item.eventtype"></h3>
            <p v-text="item.expire"></p>
            <p v-if="item.expiretime" v-text="'期限为'+item.expiretime"></p>
            <p v-text="'说明：'+item.demo"></p>
          </el-card>
        </el-timeline-item>
      </el-timeline>
    </div>
  </div>
</template>

<script>
  import { listHouseEvent } from "@/api/house_sale/HouseEvent";

  export default {
    name: 'houseEvent',
    props: ["hourseid","refresh"],
    data() {
      return {
        HouseEventList: [],
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 100,
          houseid: null,
        },
      }
    },
    created() {
      this.queryParams.houseid = this.hourseid;
      this.getList();
    },
    watch: {
      refresh() {
        this.queryParams.houseid = this.hourseid;
        this.getList();
      }
    },
    methods: {
      /** 查询房产事件列表 */
      getList() {
        listHouseEvent(this.queryParams).then(response => {
          this.HouseEventList = response.rows;
          
        });
      },
    }
  }
</script>
